
<script type="text/javascript">
	$(document).ready(function(){
		$.validator.messages.required = "";
		$.validator.messages.date = "";
		$("#FormSua").validate();
	});
</script>
<?php
	// Lấy mã sách từ thanh địa chỉ
	$id = $_GET['id'];
	
	$phanlop = new phanlopbs();
	$phanlop->MaPhanLop = $id;
	$danhsach = $phanlop->GetList();
?>
<h3>Sửa thông <?php echo $danhsach[0]['MaPhanLop']; ?> </h3>
<form id="FormSua" action="index.php?do=phanlop_sua_xuly" method="post">
	<input type="hidden" value="<?php echo $id; ?>" name="MaPhanLop" />
	<table class="Form">
		<tr>
			<td width="40%">Lớp:</td>
			<td>
            	<select name="MaLop">
                	<?php
						
                    	$lop = new lopbs();
						$dmlop = $lop->GetList();
						for($i = 0; $i < (count($dmlop)); $i++)
						{
							if($dmlop[$i]['MaLop'] == $danhsach[0]['MaLop'])
							echo "<option value='{$dmlop[$i]['MaLop']}' selected='selected'>{$dmlop[$i]['TenLop']}</option>";
							else
							echo "<option value='{$dmlop[$i]['MaLop']}' >{$dmlop[$i]['TenLop']}</option>";
							
						}
					?>
                </select>
            <span  class="requirefield">*</span></td>
		</tr>
        <tr>
			<td width="40%">Giáo viên:</td>
			<td>
            	<select name="MaGiaoVien">
                	<?php
						
                    	$giaovien = new giaovienbs();
						$dmgiaovien = $giaovien->GetList();
						for($i = 0; $i < count($dmgiaovien); $i++)
						{
							if($dmgiaovien[$i]['MaGiaoVien'] == $danhsach[0]['MaGiaoVien'])
							echo "<option value='{$dmgiaovien[$i]['MaGiaoVien']}' selected='selected'>{$dmgiaovien[$i]['TenGiaoVien']}</option>";
							else
							echo "<option value='{$dmgiaovien[$i]['MaGiaoVien']}'>{$dmgiaovien[$i]['TenGiaoVien']}</option>";
							
						}
					?>
                </select>
            <span  class="requirefield">*</span></td>
		</tr>
         <tr>
			<td width="40%">Sỉ số:</td>
			<td><input class="required"  type="text" value="<?php echo $danhsach[0]['SiSo']; ?>" name="SiSo" /><span class="requirefield">*</span></td>
		</tr>
        <tr>
			<td width="40%">Giáo viên:</td>
			<td>
            	<select name="NamHoc">
                	<?php
						
                    	$namhoc = new namhocbs();
						$dmnamhoc = $namhoc->GetListNamHoc();
						for($i = 0; $i < count($dmnamhoc); $i++)
						{
							if($dmnamhoc[$i]['NamHoc']==$dmnamhoc[0]['NamHoc'])
							echo "<option value='{$dmnamhoc[$i]['NamHoc']}' selected='selected'>{$dmnamhoc[$i]['NamHoc']}</option>";
							else
							echo "<option value='{$dmnamhoc[$i]['NamHoc']}' selected='selected'>{$dmnamhoc[$i]['NamHoc']}</option>";
							
						}
					?>
                </select>
            <span  class="requirefield">*</span></td>
		</tr>
	</table>
	<p class="GhiChuBatBuoc">(*): Trường bắt buộc phải nhập thông tin.</p>
	<input type="submit" value="Cập nhật vào CSDL" />
</form>
